package com.sharding.controller;

import com.sharding.entity.OrderItem;
import com.sharding.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("order/item")
public class OrderItemController {

    @Autowired
    private OrderItemService orderItemService;

    @GetMapping("/select")
    public List<OrderItem> select() {
        return orderItemService.getOrderItemList();
    }

    @GetMapping("/insert")
    public Boolean insert(OrderItem order) {
        return orderItemService.save(order);
    }
}
